Introduction - BACKGAMMON 5.1 ----------------------------- Backgammon is a program written entirely in 80X86 assembly language to run on IBM compatible computers. Using pattern recognition techniques developed to guide 'smart' weapons similar to those use in the recent Gulf War, Backgammon plays the game entirely without rules other than those specific to the play of the game. That is, it has no rules of thumb for deciding which of the many possible moves it will make at each turn. Rather, it examines each of the possible outcomes (there are usually fewer than 40 except in rare cases such as double ones) and uses a complex evaluation algorithm to assign a value to each of them and then takes the move with the highest value. Actually, to make its play more interesting, there is also a 'random factor' used which keeps it from playing too predictably, but this factor gets smaller and smaller as you choose to play at higher and higher skill levels. Similarly, its doubling (gambling) behavior is guided entirely by pattern recognition routines rather than explicit rules. All in all, BACKGAMMON examines about forty variables when making its decisions. These are further refined by two parameters, the stage of the game (i.e. how far into the game are we) and the relative standing of the opponents (i.e. who's ahead). The variables are things like the bunching of the pieces, the size of blockades, the evenness of piece distribution, etc. At lower levels, BACKGAMMON tends to play conservatively, trying to minimize the number of runners and keep its pieces together. At higher levels, it plays much more aggressively, trying to get an early advantage and quickly double the stakes. It also hangs on tenaciously to 'lost' games and will often surprise you with a roaring comeback. You may decide that the levels do not represent skill levels as much as different philosophies of play and, as such, it is just as rewarding to play BACKGAMMON at level zero as at level nine. Try starting at the lower levels and moving upward. After a while, you may find yourself switching levels randomly to get a different type of game on different days. BACKGAMMON was developed in an unusual fashion. The earliest experimental versions 'learned' to play by playing against themselves! After the mechanics of following the rules of the game were programmed in, the two sides were each programmed with a slightly different algorithms and set to playing (without human intervention) against one another for thousands of games or matches. It was then possible to decide, with great statistical precision, which of the two algorithms were superior. In this manner, the program was gradually improved, based upon suggestions from human testers and theoretical ideas gleaned from books on the subject. Periodically, it was necessary to pit BACKGAMMON against a group of human testers. If the automatic procedure was used too long without this kind of a reality check, it seemed that the machine play would begin to diverge into strange and unpredictable behavior that wasn't necessarily good play, but merely 'better' play than its mechanical opponent's algorithm. Sort of a machine La-La land. The result is the program you have in hand. If you find it an enjoyable and challenging backgammon opponent, please consider paying the registration fee. This modest sum of money (by computer program standards) will get you phone support, periodic updates and enhancements, the knowledge that you are contributing to the advancement of computer game playing and the satisfaction of rewarding a job well done! Work in progress includes a higher resolution product for EGA and VGA monitors. On the other hand if you can't afford it, please have a ball on me! The Mechanics of Loading and Exiting ------------------------------------ The very first thing you should remember about this game is how to exit. This is done in the rather unusual manner of holding down both shift keys and the and keys simultaneously. It requires both hands to do this which keeps you from accidentally exiting in the middle of a game. It is suggested that you hold down three of these four keys and then hit the fourth, since it is difficult to hit them all simultaneously. BACKGAMMON loads just like any other DOS EXE file. If you are loading it from a prompt, simply enter BG1991.EXE while you are in the subdirectory in which it resides, or at any time if you have placed the location of BG1991 into your system PATH. Upon loading, the game will display a copyright screen for a few seconds, then ask for your name. This name will be used in the score display and defaults to 'Human' if you simply hit . The next thing you will see is the BACKGAMMON game board with the doubling cube centered either on the left or on the right and the pieces in their holders. The computer will randomly assign, for each game, either black or white pieces to you, and either a left or right orientation to the board. This simulates real world conditions wherein you might be sitting on one side of the board or the other and be assigned one or the other color. The message at the bottom of the screen (where all playing messages expecting input will be given) is "RESET?". What occurs next depends upon what you answer to this question, which will be described after the next section. If you already know the rules, you can skip this section and go right to the section on playing the game. If you do not know the rules or are a little rusty, read them carefully. Some of them are a little tricky. The Rules of Backgammon ----------------------- Although Backgammon was invented in the Middle East many centuries ago, the contemporary game, as played in the West, differs slightly from the Middle Eastern version. This program uses the western rules, including those for matches (with the Crawford rule, named after famous gamer Johnny Crawford). At the beginning of a game, each player casts a single die. In BACKGAMMON, all dice throws are cast by the computer. Actually, you determine what is cast by when you hit the "SHAKE" button. While it is waiting, the computer will be randomizing the dice, settling on their final values at the exact instant that you press the button (space bar). So, if you feel you have some psychic influence on the dice, this gives you a way to maintain it even though the computer must handle the actual display and randomization. As stated above, there is absolutely no connection between the values thrown on the dice and the state of the current game. The resulting dice throws are as nearly perfectly random as can be achieved with a computer. So, after the initial dice cast, the player with the higher die, gets the first move and must play both dice. If the die are tied, they must be recast until they are not. Thereafter, each player's turn consists of casting both dice. If the values on the dice are not doubles (both dice the same), the player on move gets to move the exact number of spots shown on each die. Thus, if the throw was a five and a four, the player on move must move his or hers or its pieces, one of them five spaces and a second (which may be the same as the first) four spaces. The two moves can be made in either order, as long as they both are taken. One player moves his or hers or its pieces clockwise, while the other moves counterclockwise. The pieces may be moved to any point (triangle) where the opponent does not have two or more pieces already established. If the opponent has but a single piece on a point, that piece is "hit" and must go back to the beginning, which, in backgammon, is on the "bar" or the center of the board. The only exceptions occur when doubles have been cast, in which case FOUR moves are taken with the common value on the two dice or, when you can not legally move one or the other or both your pieces. This latter situation can be tricky because of a simple rule. RULE: At any given move, you MUST move as many dice spots as you can. SUBRULE: If you can move one or another of the dice, but not both, you must move the higher number of spots. This seems really easy, but can get complicated under some circumstances. For instance, suppose you have cast a one and a two. Suppose further that you have a "good" move with the two spot, but if you take it, you will be unable to move the one spot. If there is another move, however detrimental to your cause, which allows you to take both moves, you MUST make it. Remembering this rule will keep you from thinking the computer is cheating when it "forces" you to take a bad move (by not continuing after you have taken your "better" but illegal move). In all cases, the computer will sense when you have completed a legal move and will ask you to verify that this was your intention before going on. This corresponds to a second backgammon rule. RULE: A player's move is not over until he, she or it picks up the dice. Counting moves is also easy. If you have a piece on the two point and have cast a five, you may move that piece to the seven point, as long as your opponent does not have two or more pieces already on that point. RULE: A point may be occupied by pieces of but a single color. If you are "hit" by your opponent moving a piece to a point upon which you had but a single piece, that piece is moved to the bar and you must move it back on the playing field before any subsequent pieces are moved. RULE: A piece on the bar must be returned to the playing field before any other piece is moved. Counting points from the bar requires you to think of the bar as point number zero. A one spot will move you to the one point. A two to the two point, etc. As in any other case, if your opponent has two or more pieces on the target point, you can not move there. There are twenty four points on the board. The bar constitutes an extra "zeroth" point, while the 25th point can be thought of as the piece holder. The player wins who gets all 12 of its pieces onto the 25th point before the other. This is called bearing off. When all pieces are within the fourth quadrant of the board (points 19 through 24), and you get a die with exactly the correct number of points to move (counting off-the-board as point number twenty five), you can bear it off to its home piece holder. An exception occurs when all your pieces lie at a distance which is less than the smallest die cast. In that case, and only then, you can bear off your pieces, furthest from home first, to their home piece holder. Trying to move a piece home home from point number 20 with a 6 throw is illegal if you still have pieces on point number 19, for example. Again, the computer will not allow you to make illegal moves in this situation. Note that it may occur that you begin bearing off and are then hit and have a piece on the bar. That piece must return to the fourth quadrant before bearing off can continue. RULE: Pieces may be borne of the board while all remaining pieces are contained within the fourth quadrant, furthest away first, by any dice throw that equals or exceeds the distance off the board. You will notice that the pieces are distributed around the board at the beginning of the game, rather than all at the beginning. Counting points from the home piece holder (which for you, as the human player, will be either at the left or the right lower edge at the beginning of the game), you will find that you have exactly two pieces on the one point, five pieces on the twelve point, three pieces on the seventeen point and the last five on the nineteen point. The computer's pieces will be distributed exactly the same way if you count points from its piece holder, but remember, it is going in the opposite direction. The simple way to determine which pieces are yours and which way you will be moving is that you are the color with two pieces on the bottom of the board and you are moving in the direction away from those two pieces toward the first five pieces of the computer. There are two very special results to a single game. If one player bears off all of her/his/its pieces before the other has a single piece in the fourth quadrant, the winner earns double the current displayed stakes. This is true whether or not the doubling cube is in use. This outcome is called a "gammon" or "gammoning one's opponent". If one player bears of all pieces before the other has escaped from the winner's fourth quadrant, the stakes are tripled! This is called a "backgammon" or "backgammoning one's opponent". To summarize: 1) The first move is taken by the player who has the highest die after the first cast. Ties require a recast. 2) One player moves clockwise the other counterclockwise. 3) The player on move moves the number of spots showing on each die unless doubles are cast. Then four moves are made. 4) A player on the bar must reenter that piece before any other piece can be moved. 5) Pieces are borne off after all pieces are in the fourth quadrant. Pieces are borne off furthest from home first. 6) A gammon scores double and a backgammon scores triple. An additional element is introduced when you choose to use the doubling cube. This cube looks like a die, but it contains the numbers 2, 4, 8, 16, 32 and 64. Initially it shows 64 (which, in this case, substitutes for the number one). It represents the multiple of the stakes (initially one) for which the game is being played. That is, were you to be gambling for $1 a point, this cube represents the current stakes, which may rise after the game is in progress. Backgammon, unlike almost any other wagering game, requires that every subsequent bet double the stakes (and thus the name "doubling cube"). This produces some very strange probabilities that will be explained later. At first, either player may double the stakes on her or his or its move (after the very first). The double must be offered before the dice are cast. I can be accepted by the other player, in which case the game continues with the doubling cube in possession (i.e. on the side of the board) of the player who has just accepted the double. If the double is refused, the game is over and the player who has doubled wins the current multiple of the stakes showing on the doubling cube (remember, initially, 64 = 1). The player who "owns" the cube, that is, the one who has accepted the last double, is the only one who can double next. This prevents the stakes from growing too rapidly, since the one who is presumedly behind owns the cube at any given time. Initially, neither player owns the cube, so either may make the first double. Each time the stakes are doubled, the value showing on the cube is doubled. In the unlikely event that the stakes exceed 64 at any time, the cube is cycled back to 2 (which now represents 128) and both players are responsible for remembering the actual value of the stakes. Of course, the computer will not forget this! To summarize: 1) The doubling cube, if used, represents at any given time, the stakes at which the game is being played. 2) Every bet offered and accepted doubles the current stakes. 3) Initially, neither side owns the cube. After each accepted double ownership passes to that player who has accepted the double. Only the player owning the cube (after the first double) can subsequently double again. 4) When the game is over, either by one player bearing all his/her/its pieces off the board or one player failing to accept a double, the winning side scores the number of points currently displayed on the cube (remember, sixty four equals one initially). Finally, yet another twist is entered when you play a match. A match is a contest consisting of one or more games, with the total number of points being the running totals of points scored by game winners and the match winner being determined by the first player to exceed the match limit (preset at the beginning of the match). BACKGAMMON will allow matches up to and including 99 points. Traditionally, matches have an odd number of points limit, but this is not required. One further rule complicates matches. If there is but a single point remaining for one of the player to win, the very next game is played without using the doubling cube. That is, it is played for one point only. This is called the "Crawford game" after a famous gambler. The reason for this odd rule is that, when one player has only one point to go, there is no reason whatsoever for the other player not to double at each and every opportunity. If that player loses, the match is over in any case, so he/she/it might as well play for the highest possible stakes. In fact, if the player who is behind wins the Crawford game, that is exactly the betting strategy that should be played thereafter by that player! The Crawford rule gives the player who is ahead one game to win before the stakes are at least two points on every game. You should remember this, for the computer surely will! It is generally accepted in the world of backgammon, that a 25 point match (or more) is the lower limit for matches that separate the grownups from the children. That is, the winner of such a match has won by skill rather than luck. My experience with this game, which represents hundreds of thousands of contests, suggests that this conclusion is not really true. Both people and computers can enjoy strings of luck...streaks...both good and bad. My experience suggests that these streaks can easily extend over the period of a 25 point match. In fact, it was with exactly 25 point matches that all our statistics have been collected. I won about 45% of my matches. While this suggests that the computer has consistently played better than I, the very fact that I won as many matches as I did suggests that the "generally accepted" notion of a match of definitive length (of 25) is incorrect. I would suggest that a limit of 99 is more nearly correct. In any case, backgammon is at heart, a game of chance. Every player, no matter how bad, should be able to win occasionally from anyone else, and most players should be able to win a long match once in a while from anyone else. To summarize: 1) A match is a series of games played to a preassigned fixed total number of points. The first player to or over that limit wins. 2) Points per game are determined, as always, by the doubling cube except in the case that one player has only one point to go. Then, for a single game, the match is played without a doubling cube. If the player who is behind wins, the doubling cube is reintroduced for the very next game. Playing Backgammon with BACKGAMMON ---------------------------------- The first thing to note is that, after the copyright and name entry screens, hitting or will produce a help screen with abbreviated instructions. One of the headers will be flashing to indicate that the command(s) listed below it are pertinent to the current situation. This does not mean that you can not issue some other command, but the flashing group is the most likely thing for which you need help. While the help screen is present, if you hit a letter (or letter) key to get more detailed information about the use of that key. The screen will contain the empty backgammon board after the copyright and name entry screens have passed. The message at the bottom of the screen will be "RESET?" at that time. If you answer , for "No", the game will proceed to load the board with pieces without further ado, accepting whatever the current parameters are. If you answer , you will be asked a series of other short questions, the first of which is "LEVEL?". To this query, hit any number key corresponding to levels 0 through 9 (easiest through most difficult. As noted previously, these levels represent different styles of play as much as different skill levels, although, in fact, while playing against itself, the game wins more often (on average) at level 1 than at level 0, more often at level 2 than at level 1, etc. next, you will be asked to choose the type of game. Hit <1>, <2> or <3> for: 1) No betting (the doubling cube is not used) 2) Match play (doubling cube is used for a fixed number of points) 3) Standard (doubling cube is used, but score accumulates endlessly) If you choose the second alternative, you will be asked to enter the number of points to the match, 3 through 99. After this choice, the game will commence by the pieces being distributed around the board. Notice that your pieces are at the bottom of the board starting with the point upon which there are two pieces. Also, the color of the dice on the right side of the board (your side) represents your color. After the pieces have been placed, the message "Shake" will appear. Hitting the space bar will cause the computer to quit randomizing and display the dice for this (or subsequent) cast of the dice. In this sense, you are in complete control of the shake of the dice. The moment you decide to hit the space bar determines when and what values occur at that dice cast. You even get to do this for the computer, since, whenever you "pick up" the dice (by answering positively to the query "OK?" presented at the end of your turn), that is the moment the computer stops randomizing and presents itself with a dice cast. It can not be emphasized enough that the computer exerts no other influence over the cast of the dice than randomizing the dice ("shaking" them) literally thousands of times per second. You have complete control over when this process ends and what values eventually appear, both for yourself and for the computer. So, please, no comments about dice throw cheating! After you shake the dice, the message "DIE #" followed by "1" or "2" (or in the case of doubles, <3> or <4> as well). To actually move your pieces you must enter the point number of the point your piece is leaving (not its destination), playing the dice from left to right. The dice will always appear with the largest die at the left (the computer does this ordering which has no connection with the actual order in which the dice were "cast" internally). This is for your benefit and does NOT constitute evidence of cheating! If you do not wish to play the dice in this order (or can not), hit the key to reverse their order. How do you remember the point numbers? You do not have to. If you hit the pound sign, shift <3> or <#> at the top of the keyboard, numbers will appear along side their respective points and will reappear each time it is your turn thereafter until you hit the pound sign again. You must enter leading zeroes for the low numbered points. That is, you must enter <0><1> to indicate a move originating at the one point rather than simply <1>. If you are really new to the game or want a hint, hit the key (for "Take") and the computer will move for you. After the move has been taken by either you or the computer, the message "OK?" will appear. If you answer , the dice will be picked up, the computers dice will be cast and the computer will take its move. If you answer , the pieces will be moved back and you can retake the move (or, if you have asked for a hint, you can do what you want to do instead). You may also use at any time during your move to cancel any previous entries. A special key, the key, is used to enter pieces from the bar. Again, the dice are played left to right, although the computer will sense that only one of the dice is playable and reverse their order for you (just as though the key had been hit). The computer will know if you have only one possible move (or only three out of four, etc.) and will say "OK?" in that case after you have made the maximum total possible moves. After the computer's move has been made, you will again be asked to "SHAKE". If you didn't see the computer's move, the key will give you an instant replay. If you wish to double the stakes (and it is legal to do so), you hit the key before you shake your dice. The computer will either accept, in which case it will now own the doubling cube (it will move over to the other side of the board), or it will quit, giving you the score for that game. Should the computer double you, you must answer to accept, or to reject. You will be given no second chance, so be careful! At the end of the game, no matter who wins, you will be asked whether or not you wish to save it. will start up the save dialogue (asking for a name) while any other key will cause the machine to proceed back to "RESET?" where each game begins. If you answer and are in a match, you will be asked whether you really want to terminate the match. This will keep you from accidentally ending a hot match! Any other key will just cause the program to proceed into the next game in whichever mode ("no betting", etc.) you are currently using. The key will allow you to quit at any time, but you will be asked to confirm this (again, to prevent accidental termination). Special Features ---------------- Hitting this key (actually, holding down and hitting ) will make the computer go into automatic mode, playing game after game, both sides. This is good if you merely want to watch how the computer plays. Hitting again will turn this feature back off. This key combination will turn the "blink" feature on or off depending on its current state. This key allows you to switch back and forth between internal and external dice casting. If you are so paranoid about the computer cheating that you wish to throw real dice, this one is for you. It is also useful if you wish to play this program against some other. In that case, you will need to enter the other machine's dice throws externally. (Don't worry, BACKGAMMON will usually win!) Returns the board to the state it was in before your last previous dice cast. This one is good for the case that you accidentally entered the last move and confirmed "OK?" accidentally or you just want to cheat. Jumps back to the beginning of the game and starts a replay. The entire game is replayed up to the point you hit . Allows you to change the skill level any time you want. For "Playout". This command is exactly like except that it continues just to the end of the current game. It is useful for playing out games where the outcome is certain. Be careful, however, how you interpret "certain". One thing that can happen that you might not have anticipated is that the computer may take a double for you that you would not have taken (for example, you might have preferred to play for a gammon). This is used to toggle a replay on or off. This can be used to replay either retracted (by ) or stored moves (on disk) or to interrupt a replay in progress (say, for a ). This one allows you to set up a special board position. It is explained in detail below. Allows you to view the current overall score and playing level. Allows you to save or retrieve games from disk. This is explained detail below. Key Summary ----------- Used to "SHAKE" and in the setup mode (Ctrl S>). Used to return from the help screens or to escape from disk read/write functions. <#> Shift <3>, used to display point numbers. Used to accept a double. Used to reenter from the bar. Use during setup () to mean "Computer". Used to double the computer. Exchange sides. This one flips the board and asks you if you really mean to do this. Allows you to switch roles with the computer. Help. key also works. Instant playback. Used to indicate "No".

Used during setup () to indicate "Player". Quits. Resign or reject a double made by the computer. Tells the computer to take your move for you. Reverse dice order on the screen. Indicates "Yes". Setup a Position ---------------- After hitting and the board has cleared, use the '<' and '>' keys to move the cursor around the screen. Note that the cursor will visit all points, including the bar at BOTH ends of the screen. To insert pieces on an empty point, cursor to that point and then hit or

plus a digit from 1 to 9 to indicate whose pieces and how many to place on that point. To delete pieces on a point, cursor to that point and the press the key. These pieces will return to their holder. The computer will not allow you to make illegal placements (such as putting the computer's pieces on the player's bar). Once you have completed your setup, hit . You will be asked "OK?" and if you sanction it by hitting , the final question is which side to move first. Hit for computer and

for player (you). If you have trouble deciding which color belongs to whom, remember that yours are in the piece holder at the bottom of the screen. Also, your home quadrant (the computer's bearing off quadrant) is always numbered 1 to 6. Note that if you enter setup during a game, you will lose that game and can only save or replay moves from the point of the setup. Saving/Restoring Games ---------------------- At the end of each game, you are asked if you wish to save it. Only the key will start the saving process. Any other key will proceed. if you do answer , the board will clear away and you will be presented with a menu. You can also hit at any time to get to this menu. You can save or restore any fragment of any game in this fashion. You must give each saved fragment a name, after which it will be written to disk. The number of games you can save is limited only by disk space. From the Read/Save menu you can also load previously saved games or fragments of a game and replay them. You can also delete games from the disk this way, or simply view a glossary of stored games. ----------------end-of-author's-documentation--------------- Software Library Information: This disk copy provided as a service of Public (software) Library We are not the authors of this program, nor are we associated with the author in any way other than as a distributor of the program in accordance with the author's terms of distribution. Please direct shareware payments and specific questions about this program to the author of the program, whose name appears elsewhere in this documentation. If you have trouble getting in touch with the author, we will do whatever we can to help you with your questions. All programs have been tested and do run. To report problems, please use the form that is in the file PROBLEM.DOC on many of our disks or in other written for- mat with screen printouts, if possible. PsL cannot debug pro- programs over the telephone, though we can answer questions. Disks in the PsL are updated monthly, so if you did not get this disk directly from the PsL, you should be aware that the files in this set may no longer be the current versions. Also, if you got this disk from another vendor and are having prob- lems, be aware that some files may have become corrupted or lost by that vendor. Get a current, working disk from PsL. For a copy of the latest monthly software library newsletter and a list of the 3,000+ disks in the library, call or write Public (software) Library P.O.Box 35705 - F Houston, TX 77235-5705 Orders only: 1-800-2424-PSL MC/Visa/AmEx/Discover Outside of U.S. or in Texas or for general information, Call 1-713-524-6394 PsL also has an outstanding catalog for the Macintosh.